equalize the array solution in c